﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HSDc.RingleFlow.Api.Service;
using HSDc.RingleFlow.Kernel.DBPersit.Dao;
using HSDc.RingleFlow.Kernel.DBPersit.DbOrg;

namespace HSDc.RingleFlow.Kernel.DBPersit
{
    public class OrganisationServiceImpl: IOrganisationService
    {
        Api.Kernel.Org.IEmp IOrganisationService.GetEmployee(string empId)
        {
            OrganisationServiceDao dao = new OrganisationServiceDao();
            EmployeeDto dto = dao.RetrieveEmp(empId);
            Emp emp = new Emp(dto.Emp_UserID, dto.Emp_UserID, dto.Emp_Name, dto.Emp_EMail);
            return emp;
        }

        Api.Kernel.Org.IDept IOrganisationService.GetDepartment(string deptId)
        {
            OrganisationServiceDao dao = new OrganisationServiceDao();
            DepartmentDto dto = dao.RetrieveDept(deptId);
            Department dept = new Department(dto.Dept_ID, dto.Dept_OrgID, dto.Dept_Name);
            return dept;
        }

        Api.Kernel.Org.IDept IOrganisationService.GetDepartment(int Id)
        {
            OrganisationServiceDao dao = new OrganisationServiceDao();
            DepartmentDto dto = dao.RetrieveDept(Id);
            Department dept = new Department(dto.Dept_ID, dto.Dept_OrgID, dto.Dept_Name);
            return dept;
        }
    }
}
